package com.njxz.demo.service.impl;

import com.njxz.demo.domain.User;
import com.njxz.demo.mapper.AdminMapper;
import com.njxz.demo.mapper.UserMapper;

import com.njxz.demo.service.IAdminUserManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminUserManageServiceImpl implements IAdminUserManageService {

    @Autowired
    private AdminMapper adminMapper;

    @Autowired
    private UserMapper userMapper;


    @Override
    public List<User> getAllUser() {
         return adminMapper.getAllUser();

    }

    @Override
    public int deleteUserById(Integer userId) {
        return userMapper.deleteByPrimaryKey(userId);
    }

    @Override
    public int saveUser(User user) {
        return userMapper.insert(user);

    }
}
